package cn.le.bean.vo;

import org.msgpack.annotation.Message;

/**
 *  netty消息体
 */
@Message
public class NettyMsg {

    private String id;
    private int fid;
    private int tid;
    private String content;
    private int code;

    public NettyMsg(){}

    public NettyMsg(String id,int code,String content) {
        this.id = id;
        this.code = code;
        this.content = content;
    }

    public NettyMsg(String id, int fid, int tid, String content, int code) {
        this.id = id;
        this.fid = fid;
        this.tid = tid;
        this.content = content;
        this.code = code;
    }

    public NettyMsg clone(NettyMsg msg){
        NettyMsg bean = new NettyMsg(msg.getId(),msg.code,msg.content);
        bean.setFid(msg.getFid());
        bean.setTid(msg.getTid());
        return bean;
    }

    public NettyMsg(String id, int msgCode) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getFid() {
        return fid;
    }

    public void setFid(int fid) {
        this.fid = fid;
    }

    public int getTid() {
        return tid;
    }

    public void setTid(int tid) {
        this.tid = tid;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String toString() {
        return "NettyMsg{" +
                "id='" + id + '\'' +
                ", fid=" + fid +
                ", tid=" + tid +
                ", content='" + content + '\'' +
                ", code=" + code +
                '}';
    }
}
